import Vue from 'vue'
import Vuex from 'vuex'
import lib from './modules/lib'
import user from './modules/user'
import articleManage from './modules/articleManage'
import createPersistedstate from 'vuex-persistedstate'

Vue.use(Vuex)

export default new Vuex.Store({
    modules: {
        lib,
        user,
        articleManage
    },

    plugins: [
        createPersistedstate({
            key: 'storeData', // 存数据的 key 名
            paths: ['lib', 'user', 'articleManage'], // 要把哪些模块加入缓存
        })
    ]
})
